var h = innerHeight;
window.onresize = function() {
    this.console.log(innerHeight)
}
var btn1 = document.getElementById('btn1');
var btn2 = document.getElementById('btn2');
var btn3 = document.getElementById('btn3');
var btn4 = document.getElementById('btn4');
var page;

btn1.addEventListener('click', function() {
    page = open("https://baidu.com", "_blank")
})

btn2.onclick = function() {
    open("https://baidu.com", "_self")
}

btn3.onclick = function() {
    open("https://baidu.com", "iframeA");
    console.log(page)
}

//关闭网页
btn4.addEventListener('click', function() {
    page.close()
})

var res = document.getElementById('selRes');

document.body.addEventListener('mouseup', function() {
    var selObj = getSelection();

    res.innerText = `您选中的内容是:${selObj.toString()}`
})